var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, n) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var n in e)
              Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
          })(e, n);
      };
      return function (e, n) {
        function a() {
          this.constructor = e;
        }
        if ("function" != typeof n && null !== n)
          throw new TypeError(
            "Class extends value " + String(n) + " is not a constructor or null"
          );
        t(e, n),
          (e.prototype =
            null === n
              ? Object.create(n)
              : ((a.prototype = n.prototype), new a()));
      };
    })(),
  WorldCupPageView = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        (e.singlePeiLvArray = []),
        (e.yuceOrJingCai = "1"),
        e.btn_worldCupback.on(Laya.Event.CLICK, e, e.onCancleBtnClickFn),
        e.lab_wc_kataer.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_eguaduoer.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_saineijiaer.on(
          Laya.Event.CLICK,
          e,
          e.onDidSelectCountryAction
        ),
        e.lab_wc_helan.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_yinggelan.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_yilang.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_meiguo.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_weiershi.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_agenting.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_shate.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_moxige.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_bolan.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_faguo.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_aodaliya.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_danmai.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_tunisi.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_xibanya.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_gesidalijia.on(
          Laya.Event.CLICK,
          e,
          e.onDidSelectCountryAction
        ),
        e.lab_wc_deguo.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_riben.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_bilishi.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_jianada.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_moluoge.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_keluodiya.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_baxi.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_saierweiya.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_ruishi.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_kamailong.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_putaoya.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_jiana.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_wulagui.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.lab_wc_hanguo.on(Laya.Event.CLICK, e, e.onDidSelectCountryAction),
        e.btn_jingsaijilu.on(Laya.Event.CLICK, e, e.onDidClickJingCaiJiLvData),
        WebSocketService.addListener({
          caller: e,
          code: 221121,
          method: e.onLoadWorldCupPeiLvData,
        }),
        WebSocketService.addListener({
          caller: e,
          code: 221124,
          method: e.onLoadWorldCupSinglePeiLvData,
        }),
        e.tab_world_cup.on(Laya.Event.CLICK, e, e.onTabDidClickWorldCupAction),
        e.btn_worldCup_shuoming.on(
          Laya.Event.CLICK,
          e,
          e.onDidWorldCupShuoMingAction
        ),
        e.list_single_worldcup.on(
          Laya.Event.CLICK,
          e,
          e.onListWorldCupSingleAction
        ),
        (e.list_single_worldcup.selectEnable = !0),
        e.btn_single_jingcaidashen.on(
          Laya.Event.CLICK,
          e,
          e.onDidClickJingCaiDaShenAction
        ),
        e.btn_worldcup_yucedashen.on(
          Laya.Event.CLICK,
          e,
          e.onDidClickYuCeShenAction
        ),
        e.btn_worldcup_saikuang.on(
          Laya.Event.CLICK,
          e,
          e.onDidClickSaiKuangAction
        ),
        (e.list_single_worldcup.vScrollBarSkin = ""),
        e
      );
    }
    return (
      __extends(e, t),
      (e.openWorldCupView = function () {
        return (
          null == this.worldCupV && (this.worldCupV = new e()),
          this.worldCupV.initData(),
          WebSocketService.send({ c: 221121 }),
          this.worldCupV
        );
      }),
      (e.prototype.initData = function () {
        (this.tab_world_cup.selectedIndex = 0),
          (this.lable_tab_one.visible = !0),
          (this.lable_tab_two.visible = !1),
          (this.list_single_worldcup.visible = !1),
          (this.btn_jingsaijilu.label = "预测记录");
      }),
      (e.prototype.onDidSelectCountryAction = function (t) {
        if ("" != t.target.name) {
          var e = 0,
            n = this.peilvArray;
          "item_kateer" == t.target.name
            ? (e = 0)
            : "item_eguaduoer" == t.target.name
            ? (e = 1)
            : "item_saineijiaer" == t.target.name
            ? (e = 2)
            : "item_helan" == t.target.name
            ? (e = 3)
            : "item_yinggelan" == t.target.name
            ? (e = 4)
            : "item_yilang" == t.target.name
            ? (e = 5)
            : "item_meiguo" == t.target.name
            ? (e = 6)
            : "item_weiershi" == t.target.name
            ? (e = 7)
            : "item_agenting" == t.target.name
            ? (e = 8)
            : "item_shate" == t.target.name
            ? (e = 9)
            : "item_moxige" == t.target.name
            ? (e = 10)
            : "item_bolan" == t.target.name
            ? (e = 11)
            : "item_faguo" == t.target.name
            ? (e = 12)
            : "item_danmai" == t.target.name
            ? (e = 13)
            : "item_tunisi" == t.target.name
            ? (e = 14)
            : "item_aodaliya" == t.target.name
            ? (e = 15)
            : "item_xibanya" == t.target.name
            ? (e = 16)
            : "item_deguo" == t.target.name
            ? (e = 17)
            : "item_riben" == t.target.name
            ? (e = 18)
            : "item_gesidalijia" == t.target.name
            ? (e = 19)
            : "item_bilishi" == t.target.name
            ? (e = 20)
            : "item_jianada" == t.target.name
            ? (e = 21)
            : "item_moluoge" == t.target.name
            ? (e = 22)
            : "item_keluodiya" == t.target.name
            ? (e = 23)
            : "item_baxi" == t.target.name
            ? (e = 24)
            : "item_saierweiya" == t.target.name
            ? (e = 25)
            : "item_ruishi" == t.target.name
            ? (e = 26)
            : "item_kamailong" == t.target.name
            ? (e = 27)
            : "item_putaoya" == t.target.name
            ? (e = 28)
            : "item_jiana" == t.target.name
            ? (e = 29)
            : "item_wulagui" == t.target.name
            ? (e = 30)
            : "item_hanguo" == t.target.name && (e = 31),
            WorldCupGuessDialog.showWorldCupDialog(n[e]);
        }
      }),
      (e.prototype.onLoadWorldCupPeiLvData = function (t) {
        t.data && (this.peilvArray = t.data);
      }),
      (e.prototype.onLoadWorldCupSinglePeiLvData = function (t) {
        if (t.data) {
          var e = t.data;
          if (((this.singlePeiLvArray = e), e && e.length > 0)) {
            (this.tempArray = t.data), (this.list_single_worldcup.visible = !0);
            var n = void 0;
            this.tempArray = [];
            for (var a = 0; a < e.length; a++) {
              var i = e[a];
              (n = {
                item_homeTeam: { text: i.homeTeam },
                item_guestTeam: { text: i.guestTeam },
                item0: { text: i.winOdds },
                item1: { text: i.evenOdds },
                item2: { text: i.loseOdds },
                item_worldcup_time: { text: i.matchTime },
                homeTeam: i.homeTeam,
                guestTeam: i.guestTeam,
                evenOdds: i.evenOdds,
                loseOdds: i.loseOdds,
                matchId: i.matchId,
                matchTime: i.matchTime,
                winOdds: i.winOdds,
              }),
                this.tempArray.push(n);
            }
            this.list_single_worldcup.dataSource = this.tempArray;
          }
        }
      }),
      (e.prototype.onDidClickJingCaiJiLvData = function () {
        var t = "1";
        1 == this.tab_world_cup.selectedIndex && (t = "2");
        var e = WorldCupHistoryView.openWorldCupHistoryView(t);
        Laya.stage.addChild(e);
      }),
      (e.prototype.onListWorldCupSingleAction = function (t) {
        if ("" != t.target.name && "item_btn_jingcai" == t.target.name) {
          var e = this.list_single_worldcup.selectedIndex;
          WorldCupSingleDialog.showWorldCupDialog(this.singlePeiLvArray[e]);
        }
      }),
      (e.prototype.onDidClickSaiKuangAction = function (t) {
        var e = WorldCupHistoryView.openWorldCupHistoryView("3");
        Laya.stage.addChild(e);
      }),
      (e.prototype.onTabDidClickWorldCupAction = function (t) {
        "" != t.target.name &&
          ("item0" == t.target.name
            ? ((this.lable_tab_one.visible = !0),
              (this.lable_tab_two.visible = !1),
              WebSocketService.send({ c: 221121 }),
              (this.yuceOrJingCai = "1"),
              (this.btn_jingsaijilu.label = "预测记录"))
            : ((this.lable_tab_one.visible = !1),
              (this.lable_tab_two.visible = !0),
              WebSocketService.send({ c: 221124 }),
              (this.yuceOrJingCai = "2"),
              (this.btn_jingsaijilu.label = "竞猜记录")));
      }),
      (e.prototype.onDidWorldCupShuoMingAction = function () {
        var t = CaslnoRulesView.showCaslRuleView("worldCupSM");
        (t.y = 50), (t.height = 570), Laya.stage.addChild(t);
      }),
      (e.prototype.onDidClickJingCaiDaShenAction = function () {
        var t = WorldCupHistoryView.openWorldCupHistoryView("5");
        Laya.stage.addChild(t);
      }),
      (e.prototype.onDidClickYuCeShenAction = function () {
        var t = WorldCupHistoryView.openWorldCupHistoryView("4");
        Laya.stage.addChild(t);
      }),
      (e.prototype.onCancleBtnClickFn = function () {
        this.removeSelf();
      }),
      e
    );
  })(ui.ActivityController.WorldCupPageViewUI);
